/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author mosipdkara
 */
@Entity
@Table(name = "personel")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Personel.findAll", query = "SELECT p FROM Personel p"),
    @NamedQuery(name = "Personel.findByPersonelId", query = "SELECT p FROM Personel p WHERE p.personelId = :personelId"),
    @NamedQuery(name = "Personel.findByPersonelAd", query = "SELECT p FROM Personel p WHERE p.personelAd = :personelAd"),
    @NamedQuery(name = "Personel.findByPersonelSoyad", query = "SELECT p FROM Personel p WHERE p.personelSoyad = :personelSoyad"),
    @NamedQuery(name = "Personel.findByPersonelSicilNumarasi", query = "SELECT p FROM Personel p WHERE p.personelSicilNumarasi = :personelSicilNumarasi"),
    @NamedQuery(name = "Personel.findByPersonelPosta", query = "SELECT p FROM Personel p WHERE p.personelPosta = :personelPosta")})
public class Personel implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "PersonelId")
    private Integer personelId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "PersonelAd")
    private String personelAd;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "PersonelSoyad")
    private String personelSoyad;
    @Column(name = "PersonelSicilNumarasi")
    private Integer personelSicilNumarasi;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "PersonelPosta")
    private String personelPosta;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "logSahibiPersonelId")
    private List<Iskayit> iskayitList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "talepUstlenenPersonelId")
    private List<Talepedilenis> talepedilenisList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "talepEdenPersonelId")
    private List<Talepedilenis> talepedilenisList1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "personelId")
    private List<Kimlikdogrulama> kimlikdogrulamaList;

    public Personel() {
    }

    public Personel(Integer personelId) {
        this.personelId = personelId;
    }

    public Personel(Integer personelId, String personelAd, String personelSoyad, String personelPosta) {
        this.personelId = personelId;
        this.personelAd = personelAd;
        this.personelSoyad = personelSoyad;
        this.personelPosta = personelPosta;
    }

    public Integer getPersonelId() {
        return personelId;
    }

    public void setPersonelId(Integer personelId) {
        this.personelId = personelId;
    }

    public String getPersonelAd() {
        return personelAd;
    }

    public void setPersonelAd(String personelAd) {
        this.personelAd = personelAd;
    }

    public String getPersonelSoyad() {
        return personelSoyad;
    }

    public void setPersonelSoyad(String personelSoyad) {
        this.personelSoyad = personelSoyad;
    }

    public Integer getPersonelSicilNumarasi() {
        return personelSicilNumarasi;
    }

    public void setPersonelSicilNumarasi(Integer personelSicilNumarasi) {
        this.personelSicilNumarasi = personelSicilNumarasi;
    }

    public String getPersonelPosta() {
        return personelPosta;
    }

    public void setPersonelPosta(String personelPosta) {
        this.personelPosta = personelPosta;
    }

    @XmlTransient
    public List<Iskayit> getIskayitList() {
        return iskayitList;
    }

    public void setIskayitList(List<Iskayit> iskayitList) {
        this.iskayitList = iskayitList;
    }

    @XmlTransient
    public List<Talepedilenis> getTalepedilenisList() {
        return talepedilenisList;
    }

    public void setTalepedilenisList(List<Talepedilenis> talepedilenisList) {
        this.talepedilenisList = talepedilenisList;
    }

    @XmlTransient
    public List<Talepedilenis> getTalepedilenisList1() {
        return talepedilenisList1;
    }

    public void setTalepedilenisList1(List<Talepedilenis> talepedilenisList1) {
        this.talepedilenisList1 = talepedilenisList1;
    }

    @XmlTransient
    public List<Kimlikdogrulama> getKimlikdogrulamaList() {
        return kimlikdogrulamaList;
    }

    public void setKimlikdogrulamaList(List<Kimlikdogrulama> kimlikdogrulamaList) {
        this.kimlikdogrulamaList = kimlikdogrulamaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (personelId != null ? personelId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Personel)) {
            return false;
        }
        Personel other = (Personel) object;
        if ((this.personelId == null && other.personelId != null) || (this.personelId != null && !this.personelId.equals(other.personelId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.Personel[ personelId=" + personelId + " ]";
    }
    
}
